home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / AIncludes / Terminals.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  12.0 KB  |  496 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Terminals.a
  3. ;
  4. ;    Contains:    Communications Toolbox Terminal tool Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1988-1998, 1995-1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__TERMINALS__') = 'UNDEFINED' THEN
  18. __TERMINALS__ SET 1
  19.  
  20.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  21.     include 'ConditionalMacros.a'
  22.     ENDIF
  23.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  24.     include 'Dialogs.a'
  25.     ENDIF
  26.     IF &TYPE('__CTBUTILITIES__') = 'UNDEFINED' THEN
  27.     include 'CTBUtilities.a'
  28.     ENDIF
  29.     IF &TYPE('__CONNECTIONS__') = 'UNDEFINED' THEN
  30.     include 'Connections.a'
  31.     ENDIF
  32.  
  33.  
  34. curTMVersion                    EQU        2                    ; current Terminal Manager version 
  35.  
  36. curTermEnvRecVers                EQU        0                    ; current Terminal Manager Environment Record version 
  37.  
  38.                                                             ; error codes    
  39. tmGenericError                    EQU        -1
  40. tmNoErr                            EQU        0
  41. tmNotSent                        EQU        1
  42. tmEnvironsChanged                EQU        2
  43. tmNotSupported                    EQU        7
  44. tmNoTools                        EQU        8
  45. ; typedef OSErr                         TMErr
  46.  
  47.  
  48. tmInvisible                        EQU        $01
  49. tmSaveBeforeClear                EQU        $02
  50. tmNoMenus                        EQU        $04
  51. tmAutoScroll                    EQU        $08
  52. tmConfigChanged                    EQU        $10
  53. ; typedef unsigned long                 TMFlags
  54.  
  55.  
  56. selTextNormal                    EQU        $01
  57. selTextBoxed                    EQU        $02
  58. selGraphicsMarquee                EQU        $04
  59. selGraphicsLasso                EQU        $08
  60. tmSearchNoDiacrit                EQU        $0100
  61. tmSearchNoCase                    EQU        $0200
  62. ; typedef unsigned short                 TMSearchTypes
  63.  
  64. ; typedef short                         TMSelTypes
  65.  
  66.  
  67. cursorText                        EQU        1
  68. cursorGraphics                    EQU        2
  69. ; typedef unsigned short                 TMCursorTypes
  70.  
  71.  
  72. tmTextTerminal                    EQU        $01
  73. tmGraphicsTerminal                EQU        $02
  74. ; typedef unsigned short                 TMTermTypes
  75.  
  76. TermDataBlock            RECORD 0
  77. flags                     ds.w    1                ; offset: $0 (0)
  78. theData                     ds.l    1                ; offset: $2 (2)
  79. auxData                     ds.l    1                ; offset: $6 (6)
  80. reserved                 ds.l    1                ; offset: $A (10)
  81. sizeof                     EQU *                    ; size:   $E (14)
  82.                         ENDR
  83. ; typedef struct TermDataBlock *        TermDataBlockPtr
  84.  
  85. ; typedef TermDataBlockPtr *            TermDataBlockH
  86.  
  87. ; typedef TermDataBlockPtr *            TermDataBlockHandle
  88.  
  89. TermEnvironRec            RECORD 0
  90. version                     ds.w    1                ; offset: $0 (0)
  91. termType                 ds.w    1                ; offset: $2 (2)
  92. textRows                 ds.w    1                ; offset: $4 (4)
  93. textCols                 ds.w    1                ; offset: $6 (6)
  94. cellSize                 ds        Point            ; offset: $8 (8)
  95. graphicSize                 ds        Rect            ; offset: $C (12)
  96. slop                     ds        Point            ; offset: $14 (20)
  97. auxSpace                 ds        Rect            ; offset: $18 (24)
  98. sizeof                     EQU *                    ; size:   $20 (32)
  99.                         ENDR
  100. ; typedef struct TermEnvironRec *        TermEnvironPtr
  101.  
  102. TMSelection                RECORD 0
  103. selRect                     ds        Rect            ; offset: $0 (0)
  104.                          ORG 0
  105. selRgnHandle             ds.l    1                ; offset: $0 (0)
  106.                          ORG 8
  107. sizeof                     EQU *                    ; size:   $8 (8)
  108.                         ENDR
  109.  
  110.  
  111. ; typedef TermRecord *                    TermPtr
  112.  
  113. ; typedef TermPtr *                        TermHandle
  114.  
  115. ;     TMTermTypes     
  116. TermRecord                RECORD 0
  117. procID                     ds.w    1                ; offset: $0 (0)
  118. flags                     ds.l    1                ; offset: $2 (2)
  119. errCode                     ds.w    1                ; offset: $6 (6)
  120. refCon                     ds.l    1                ; offset: $8 (8)
  121. userData                 ds.l    1                ; offset: $C (12)
  122. defProc                     ds.l    1                ; offset: $10 (16)
  123. config                     ds.l    1                ; offset: $14 (20)
  124. oldConfig                 ds.l    1                ; offset: $18 (24)
  125. environsProc             ds.l    1                ; offset: $1C (28)
  126. reserved1                 ds.l    1                ; offset: $20 (32)
  127. reserved2                 ds.l    1                ; offset: $24 (36)
  128. tmPrivate                 ds.l    1                ; offset: $28 (40)
  129. sendProc                 ds.l    1                ; offset: $2C (44)
  130. breakProc                 ds.l    1                ; offset: $30 (48)
  131. cacheProc                 ds.l    1                ; offset: $34 (52)
  132. clikLoop                 ds.l    1                ; offset: $38 (56)
  133. owner                     ds.l    1                ; offset: $3C (60)
  134. termRect                 ds        Rect            ; offset: $40 (64)
  135. viewRect                 ds        Rect            ; offset: $48 (72)
  136. visRect                     ds        Rect            ; offset: $50 (80)
  137. lastIdle                 ds.l    1                ; offset: $58 (88)
  138. selection                 ds        TMSelection        ; offset: $5C (92)
  139. selType                     ds.w    1                ; offset: $64 (100)
  140. mluField                 ds.l    1                ; offset: $66 (102)
  141. sizeof                     EQU *                    ; size:   $6A (106)
  142.                         ENDR
  143.  
  144. ;
  145. ; pascal TMErr InitTM(void )
  146. ;
  147.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  148.         IMPORT_CFM_FUNCTION InitTM
  149.     ENDIF
  150.  
  151. ;
  152. ; pascal Handle TMGetVersion(TermHandle hTerm)
  153. ;
  154.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  155.         IMPORT_CFM_FUNCTION TMGetVersion
  156.     ENDIF
  157.  
  158. ;
  159. ; pascal short TMGetTMVersion(void )
  160. ;
  161.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  162.         IMPORT_CFM_FUNCTION TMGetTMVersion
  163.     ENDIF
  164.  
  165. ;
  166. ; pascal TermHandle TMNew(const Rect *termRect, const Rect *viewRect, TMFlags flags, short procID, WindowPtr owner, TerminalSendUPP sendProc, TerminalCacheUPP cacheProc, TerminalBreakUPP breakProc, TerminalClikLoopUPP clikLoop, TerminalEnvironsUPP environsProc, long refCon, long userData)
  167. ;
  168.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  169.         IMPORT_CFM_FUNCTION TMNew
  170.     ENDIF
  171.  
  172. ;
  173. ; pascal void TMDispose(TermHandle hTerm)
  174. ;
  175.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  176.         IMPORT_CFM_FUNCTION TMDispose
  177.     ENDIF
  178.  
  179. ;
  180. ; pascal void TMKey(TermHandle hTerm, const EventRecord *theEvent)
  181. ;
  182.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  183.         IMPORT_CFM_FUNCTION TMKey
  184.     ENDIF
  185.  
  186. ;
  187. ; pascal void TMUpdate(TermHandle hTerm, RgnHandle visRgn)
  188. ;
  189.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  190.         IMPORT_CFM_FUNCTION TMUpdate
  191.     ENDIF
  192.  
  193. ;
  194. ; pascal void TMPaint(TermHandle hTerm, const TermDataBlock *theTermData, const Rect *theRect)
  195. ;
  196.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  197.         IMPORT_CFM_FUNCTION TMPaint
  198.     ENDIF
  199.  
  200. ;
  201. ; pascal void TMActivate(TermHandle hTerm, Boolean activate)
  202. ;
  203.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  204.         IMPORT_CFM_FUNCTION TMActivate
  205.     ENDIF
  206.  
  207. ;
  208. ; pascal void TMResume(TermHandle hTerm, Boolean resume)
  209. ;
  210.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  211.         IMPORT_CFM_FUNCTION TMResume
  212.     ENDIF
  213.  
  214. ;
  215. ; pascal void TMClick(TermHandle hTerm, const EventRecord *theEvent)
  216. ;
  217.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  218.         IMPORT_CFM_FUNCTION TMClick
  219.     ENDIF
  220.  
  221. ;
  222. ; pascal void TMIdle(TermHandle hTerm)
  223. ;
  224.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  225.         IMPORT_CFM_FUNCTION TMIdle
  226.     ENDIF
  227.  
  228. ;
  229. ; pascal long TMStream(TermHandle hTerm, void *theBuffer, long theLength, CMFlags flags)
  230. ;
  231.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  232.         IMPORT_CFM_FUNCTION TMStream
  233.     ENDIF
  234.  
  235. ;
  236. ; pascal Boolean TMMenu(TermHandle hTerm, short menuID, short item)
  237. ;
  238.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  239.         IMPORT_CFM_FUNCTION TMMenu
  240.     ENDIF
  241.  
  242. ;
  243. ; pascal void TMReset(TermHandle hTerm)
  244. ;
  245.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  246.         IMPORT_CFM_FUNCTION TMReset
  247.     ENDIF
  248.  
  249. ;
  250. ; pascal void TMClear(TermHandle hTerm)
  251. ;
  252.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  253.         IMPORT_CFM_FUNCTION TMClear
  254.     ENDIF
  255.  
  256. ;
  257. ; pascal void TMResize(TermHandle hTerm, const Rect *newViewRect)
  258. ;
  259.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  260.         IMPORT_CFM_FUNCTION TMResize
  261.     ENDIF
  262.  
  263. ;
  264. ; pascal long TMGetSelect(TermHandle hTerm, Handle theData, ResType *theType)
  265. ;
  266.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  267.         IMPORT_CFM_FUNCTION TMGetSelect
  268.     ENDIF
  269.  
  270. ;
  271. ; pascal void TMGetLine(TermHandle hTerm, short lineNo, TermDataBlock *theTermData)
  272. ;
  273.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  274.         IMPORT_CFM_FUNCTION TMGetLine
  275.     ENDIF
  276.  
  277. ;
  278. ; pascal void TMSetSelection(TermHandle hTerm, const TMSelection *theSelection, TMSelTypes selType)
  279. ;
  280.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  281.         IMPORT_CFM_FUNCTION TMSetSelection
  282.     ENDIF
  283.  
  284. ;
  285. ; pascal void TMScroll(TermHandle hTerm, short dh, short dv)
  286. ;
  287.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  288.         IMPORT_CFM_FUNCTION TMScroll
  289.     ENDIF
  290.  
  291. ;
  292. ; pascal Boolean TMValidate(TermHandle hTerm)
  293. ;
  294.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  295.         IMPORT_CFM_FUNCTION TMValidate
  296.     ENDIF
  297.  
  298. ;
  299. ; pascal void TMDefault(Ptr *theConfig, short procID, Boolean allocate)
  300. ;
  301.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  302.         IMPORT_CFM_FUNCTION TMDefault
  303.     ENDIF
  304.  
  305. ;
  306. ; pascal Handle TMSetupPreflight(short procID, long *magicCookie)
  307. ;
  308.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  309.         IMPORT_CFM_FUNCTION TMSetupPreflight
  310.     ENDIF
  311.  
  312. ;
  313. ; pascal void TMSetupSetup(short procID, const void *theConfig, short count, DialogPtr theDialog, long *magicCookie)
  314. ;
  315.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  316.         IMPORT_CFM_FUNCTION TMSetupSetup
  317.     ENDIF
  318.  
  319. ;
  320. ; pascal Boolean TMSetupFilter(short procID, const void *theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie)
  321. ;
  322.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  323.         IMPORT_CFM_FUNCTION TMSetupFilter
  324.     ENDIF
  325.  
  326. ;
  327. ; pascal void TMSetupItem(short procID, const void *theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie)
  328. ;
  329.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  330.         IMPORT_CFM_FUNCTION TMSetupItem
  331.     ENDIF
  332.  
  333. ;
  334. ; pascal void TMSetupXCleanup(short procID, const void *theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie)
  335. ;
  336.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  337.         IMPORT_CFM_FUNCTION TMSetupXCleanup
  338.     ENDIF
  339.  
  340. ;
  341. ; pascal void TMSetupPostflight(short procID)
  342. ;
  343.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  344.         IMPORT_CFM_FUNCTION TMSetupPostflight
  345.     ENDIF
  346.  
  347. ;
  348. ; pascal Ptr TMGetConfig(TermHandle hTerm)
  349. ;
  350.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  351.         IMPORT_CFM_FUNCTION TMGetConfig
  352.     ENDIF
  353.  
  354. ;
  355. ; pascal short TMSetConfig(TermHandle hTerm, const void *thePtr)
  356. ;
  357.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  358.         IMPORT_CFM_FUNCTION TMSetConfig
  359.     ENDIF
  360.  
  361. ;
  362. ; pascal OSErr TMIntlToEnglish(TermHandle hTerm, const void *inputPtr, Ptr *outputPtr, short language)
  363. ;
  364.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  365.         IMPORT_CFM_FUNCTION TMIntlToEnglish
  366.     ENDIF
  367.  
  368. ;
  369. ; pascal OSErr TMEnglishToIntl(TermHandle hTerm, const void *inputPtr, Ptr *outputPtr, short language)
  370. ;
  371.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  372.         IMPORT_CFM_FUNCTION TMEnglishToIntl
  373.     ENDIF
  374.  
  375. ;
  376. ; pascal void TMGetToolName(short id, Str255 name)
  377. ;
  378.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  379.         IMPORT_CFM_FUNCTION TMGetToolName
  380.     ENDIF
  381.  
  382. ;
  383. ; pascal short TMGetProcID(ConstStr255Param name)
  384. ;
  385.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  386.         IMPORT_CFM_FUNCTION TMGetProcID
  387.     ENDIF
  388.  
  389. ;
  390. ; pascal void TMSetRefCon(TermHandle hTerm, long refCon)
  391. ;
  392.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  393.         IMPORT_CFM_FUNCTION TMSetRefCon
  394.     ENDIF
  395.  
  396. ;
  397. ; pascal long TMGetRefCon(TermHandle hTerm)
  398. ;
  399.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  400.         IMPORT_CFM_FUNCTION TMGetRefCon
  401.     ENDIF
  402.  
  403. ;
  404. ; pascal void TMSetUserData(TermHandle hTerm, long userData)
  405. ;
  406.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  407.         IMPORT_CFM_FUNCTION TMSetUserData
  408.     ENDIF
  409.  
  410. ;
  411. ; pascal long TMGetUserData(TermHandle hTerm)
  412. ;
  413.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  414.         IMPORT_CFM_FUNCTION TMGetUserData
  415.     ENDIF
  416.  
  417. ;
  418. ; pascal short TMAddSearch(TermHandle hTerm, ConstStr255Param theString, const Rect *where, TMSearchTypes searchType, TerminalSearchCallBackUPP callBack)
  419. ;
  420.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  421.         IMPORT_CFM_FUNCTION TMAddSearch
  422.     ENDIF
  423.  
  424. ;
  425. ; pascal void TMRemoveSearch(TermHandle hTerm, short refnum)
  426. ;
  427.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  428.         IMPORT_CFM_FUNCTION TMRemoveSearch
  429.     ENDIF
  430.  
  431. ;
  432. ; pascal void TMClearSearch(TermHandle hTerm)
  433. ;
  434.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  435.         IMPORT_CFM_FUNCTION TMClearSearch
  436.     ENDIF
  437.  
  438. ;
  439. ; pascal Point TMGetCursor(TermHandle hTerm, TMCursorTypes cursType)
  440. ;
  441.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  442.         IMPORT_CFM_FUNCTION TMGetCursor
  443.     ENDIF
  444.  
  445. ;
  446. ; pascal TMErr TMGetTermEnvirons(TermHandle hTerm, TermEnvironRec *theEnvirons)
  447. ;
  448.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  449.         IMPORT_CFM_FUNCTION TMGetTermEnvirons
  450.     ENDIF
  451.  
  452. ;
  453. ; pascal short TMChoose(TermHandle *hTerm, Point where, TerminalChooseIdleUPP idleProc)
  454. ;
  455.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  456.         IMPORT_CFM_FUNCTION TMChoose
  457.     ENDIF
  458.  
  459. ;
  460. ; pascal void TMEvent(TermHandle hTerm, const EventRecord *theEvent)
  461. ;
  462.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  463.         IMPORT_CFM_FUNCTION TMEvent
  464.     ENDIF
  465.  
  466. ;
  467. ; pascal Boolean TMDoTermKey(TermHandle hTerm, ConstStr255Param theKey)
  468. ;
  469.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  470.         IMPORT_CFM_FUNCTION TMDoTermKey
  471.     ENDIF
  472.  
  473. ;
  474. ; pascal short TMCountTermKeys(TermHandle hTerm)
  475. ;
  476.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  477.         IMPORT_CFM_FUNCTION TMCountTermKeys
  478.     ENDIF
  479.  
  480. ;
  481. ; pascal void TMGetIndTermKey(TermHandle hTerm, short id, Str255 theKey)
  482. ;
  483.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  484.         IMPORT_CFM_FUNCTION TMGetIndTermKey
  485.     ENDIF
  486.  
  487. ;
  488. ; pascal void TMGetErrorString(TermHandle hTerm, short id, Str255 errMsg)
  489. ;
  490.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  491.         IMPORT_CFM_FUNCTION TMGetErrorString
  492.     ENDIF
  493.  
  494.     ENDIF ; __TERMINALS__ 
  495.  
  496.